private _target = player;
if (alive _target) then {
	//使乘员先下车
	_targetVeh=objNull;
	if(player getVariable ["AT_Revive_isUnconscious",false]) then {
		_nearVehs = nearestObjects [player, ["car","Tank","Helicopter","Plane","ship","Motorcycle"], 9]; //5
		_targetVeh = if (count _nearVehs > 0)then [{_nearVehs select 0},{objNull}];
		if (!(isNull _targetVeh)) then {
			{
				if((_x getVariable ["AT_Revive_isUnconscious",false]) && _x == player && !(alive _targetVeh && {abs speed _targetVeh > 0 || {_targetVeh isKindOf "air"}})) exitwith {
					moveout _x;
				};
			} forEach crew _targetVeh;
		};
	};
	// _target setVariable ["AT_Revive_isDragged", player, true];
	// sleep 6;
	_target setVariable ["AT_Revive_isDragged", objNull, true];
	if(player getVariable ["AT_Revive_isUnconscious",false]) then {
		_target setVariable ["AT_Revive_isUnconscious", false, true];
		[_target, "amovppnemstpsraswrfldnon"] remoteExec ["playmove", 0, false];
		if (AT_Revive_Camera==1) then {
			[] remoteExec ["ATHSC_fnc_exit", _target, false];
		};
	};
	if (!isPlayer _target) then {
		_target enableSimulation true;
		_target allowDamage true;
		_target setCaptive false;
		[_target, "amovppnemstpsraswrfldnon"] remoteExec ["playmove", 0, false];
	};
	// Fix revive underwater
	if (surfaceIsWater (getPos _target)) then {
		[_target, ""] remoteExec ["switchmove", 0, false];
	};
	_target setDamage 0;
	//如果在坐车，就放到车里
	if (alive _targetVeh 
	&& {abs speed _targetVeh > 0 || {_targetVeh isKindOf "air"}} 
	&& {_targetVeh emptyPositions "Cargo" > 0 || {_targetVeh emptyPositions "Gunner" > 0} || {_targetVeh emptyPositions "Commander" > 0} || {_targetVeh emptyPositions "Driver" > 0}}) then {
		_target moveInAny _targetVeh;
	};
};